﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PSLib.Parsing.Common.Search
{
    public partial class Query
    {
        public Query(params QParam[] conditionSequence)
        {
            this.Sequence = new List<QParam>();
            if (conditionSequence == null) throw new ArgumentException("conditionSequence is null", "conditionSequence");
            if (conditionSequence.Length == 0) throw new ArgumentException("conditionSequence is empty", "conditionSequence");
            if (conditionSequence.Where(item => item.Selectable).ToList().Count != 1) throw new ArgumentException("conditionSequence must contain single select param", "conditionSequence");

            this.Sequence.AddRange(conditionSequence);
        }

        public List<QParam> Sequence { get; private set; }
    }
}
